package com.lbm.business.service.impl;

import java.util.List;

import com.lbm.baseclass.exception.ServiceException;
import com.lbm.baseclass.service.impl.BaseServiceImpl;
import com.lbm.business.service.IModuleOperateService;
import com.lbm.model.ModuleOperate;

public class ModuleOperateServiceImpl  extends BaseServiceImpl implements IModuleOperateService{
	/**
	 * 通过HQL构造查询条件来查询符合条件的UserOperate信息
	 * 
	 * @param hql
	 * @return List
	 * @throws DataAccessException
	 */
	@Override
	public List getModuleOperateByHQL(String hql) throws ServiceException {
		return baseDAO.getValueObjectsByHQL(hql);
	}
	/**
	 * 根据主键查询UserOperate信息明细
	 * 
	 * @param id
	 * @throws DataAccessException
	 */
	@Override
	public ModuleOperate getModuleOperateById(String id) throws ServiceException {
		ModuleOperate moduleOperate=null;
		List list=baseDAO.getValueObjectsByHQL(" from ModuleOperate where moduleOperateid='"+id+"'");
		if(!list.isEmpty()&&list.size()>0){
			moduleOperate=(ModuleOperate)list.get(0);
		}
		return moduleOperate;
	}
	/**
	 * 查询所有的UserOperate信息
	 * 
	 * @param hql
	 * @return List
	 * @throws DataAccessException
	 */
	@Override
	public List getAllModuleOperate() throws ServiceException {
		return baseDAO.getValueObjectsByHQL(" from ModuleOperate");
	}
	/**
	 * 新增、修改UserOperate信息
	 * 
	 * @param UserOperate
	 * @throws DataAccessException
	 */
	@Override
	public void saveOrUpdateModuleOperate(ModuleOperate moduleOperate) throws ServiceException {
		baseDAO.saveOrUpdateVO(moduleOperate);
	}
	/**
	 * 删除UserOperate信息
	 * 
	 * @param id
	 * @throws DataAccessException
	 */
	@Override
	public void deleteModuleOperate(String id) throws ServiceException {
		ModuleOperate moduleOperate=this.getModuleOperateById(id);
		baseDAO.deleteVO(moduleOperate);
	}
}
